package com.example.testapp.activity.view.dialog;

import android.app.Activity;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.Log;

/**
 * 一些常用的系统配置信息 获取自定义的配置信息 类
 * Created by l on 2016/9/1.
 */
public class Configure {

    public static final int NOTE1 = 1;

    public static int screenHeight = 0;
    public static int screenWidth = 0;
    public static float screenDensity = 0;
    public static int densityDpi = 0;
    public static int version = Integer.valueOf(Build.VERSION.SDK_INT);


    public static void init(Activity context) {
        if(screenDensity == 0 || screenWidth == 0 || screenHeight == 0){
            DisplayMetrics dm = new DisplayMetrics();
            context.getWindowManager().getDefaultDisplay().getMetrics(dm);
            Configure.screenDensity = dm.density;
            Configure.screenWidth = dm.widthPixels;
            Configure.screenHeight = dm.heightPixels;
            Configure.densityDpi = dm.densityDpi;
        }
        Log.i("SCREEN CONFIG", "screenHeight:"+screenHeight+";screenWidth:"+screenWidth
                +";screenDensity:"+screenDensity+";densityDpi:"+densityDpi);
    }
}
